﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SurvivalStrategy.WorldData.ItemComponents;

namespace SurvivalStrategy.Entities.EnitityComponents
{
    public class EntityItemContainter : EntitiyComponent
    {
        private List<ItemComponent> itemList;
        public int Count { get { return itemList.Count; } }
        public int Capacity { get; internal set; }

        public EntityItemContainter()
        {
            itemList = new List<ItemComponent>();
        }

        public bool AddItem(ItemComponent item)
        {
            if (Count < Capacity)
            {
                itemList.Add(item);
                return true;
            }else return false;
        }

        public void RemoveItem(ItemComponent item)
        {
            itemList.Remove(item);
        }

        public bool ContainsItem(ItemComponent item)
        {
            return itemList.Contains(item);
        }

        public List<ItemComponent> GetItemsList()
        {
            return itemList;
        }
    }
}
